<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="@{'/public/stylesheets/forms.css'}">

<link rel="stylesheet" href="@{'/public/stylesheets/forms.css'}">
<link rel="stylesheet" href="@{'/public/stylesheets/frames.css'}">


<script type="text/javascript">
  function PreselectMyItem(${organization.category})
  {
    // Get a reference to the drop-down
    var myDropdownList = document.organization.cat;

    // Loop through all the items
    for (iLoop = 0; iLoop< myDropdownList.options.length; iLoop++)
    {    
      if (myDropdownList.options[iLoop].value == ${organization.category})
      {
        // Item is found. Set its selected property, and exit the loop
        myDropdownList.options[iLoop].selected = true;
        break;
      }
    }
  }
</script>


</head>
<body>


	<div id=main>
	
	#{if message!=null}<div class=success>${message}</div>#{/if}
		<h3>Edit an Organization </h3>
		#{if flash.error}
		<p style="color:#c00">
		${flash.error}
		</p>
		#{/if}

		<form name=organization action="@{Organizations.organizationEdited(organization.id)}"
			method="POST" enctype="multipart/form-data">
			<div class="content">
				<div class="row">
					<div class="left">Organization Name*</div>
					<div class="right">
						<input name="name" type="text" class="text" required
							value=${organization.name} autofocus="autofocus" />
					</div>
					<div class="clear"></div>
				</div>

				<div class="row">
					<div class="left">Organization Email*</div>
					<div class="right">
						<input name=email type="Email" size="50" class="text" required
							value=${organization.email} />
					</div>
					<div class="clear"></div>
				</div>

				<div class="row">
					<div class="left">Address*</div>
					<div class="right">
						<input name="address" type="text" class="text" required
							value=${organization.address} />
					</div>
					<div class="clear"></div>
				</div>

				<div class="row">
					<div class="left">Description*</div>
					<div class="right">
						<textarea rows="10" cols="50" name="description" required>${organization.description}</textarea>
					</div>
					<div class="clear"></div>
				</div>

				<div class="row">
					<div class="left">Type</div>
					<div class="right">

					
					
			#{if organization.type=="Public"} 
			<input type="radio" name="type" value="Public" checked />Public <br/> 
			<input type="radio" name="type" value="Private" />Private<br /> 
			<input type="radio" name="type" value="Closed Organization" />Closed Organization
			#{/if}
			
			#{if organization.type=="Private"} 
			<input type="radio" name="type" value="Public"  />Public <br/> 
			<input type="radio" name="type" value="Private" checked />Private<br /> 
			<input type="radio" name="type" value="Closed Organization" />Closed Organization
			#{/if}
			
			#{if organization.type=="Closed Organization"} 
			<input type="radio" name="type" value="Public"  />Public <br/> 
			<input type="radio" name="type" value="Private" />Private<br /> 
			<input type="radio" name="type" value="Closed Organization" checked />Closed Organization
			#{/if}					
					
													  

					</div>
					<div class="clear"></div>
				</div>


				<div class="row">
					<div class="left">Upload a Photo</div>
					<div class="right">
						<input type="file" id="photo" name=organization.picture value=${organization.picture} />
					</div>
					<div class="clear"></div>
				</div>

				<div class="row">
					<div class="left">Category</div>
					<div class="right">
						<select name="category" id="cat">
							<option value="Agriculture, forest and fishing">Agriculture,
								forest and fishing</option>
							<option value="Construction">Construction</option>
							<option value="Education">Education</option>
							<option value="Health">Health</option>
							<option value="IT and telecommunications services">IT
								and telecommunications services</option>
							<option value="Media and creative services">Media and
								creative services</option>
							<option value="Personal services">Personal services</option>
							<option value="Professional and business services">Professional
								and business services</option>
							<option value="Retail">Retail</option>
							<option value="Manufacturing">Manufacturing</option>
							<option value="Other">Other</option>

						</select>
					</div>
					<div class="clear"></div>
				</div>

<div class="row">
					<div class="left">Tagging</div>
					<div class="right">
					
			#{if organization.tagging==true} 
			<input type="radio" name="tag" value="true" checked />Allow Tagging <br/> 
			<input type="radio" name="tag" value="false" />Don't Allow Tagging'<br />  
			#{/if}
													  
			#{if organization.tagging==false} 
			<input type="radio" name="tag" value="true"  />Allow Tagging <br/> 
			<input type="radio" name="tag" value="false" checked/>Don't Allow Tagging<br /> 
			#{/if}
					</div>
					<div class="clear"></div>
				</div>
				
				<div class="row">
					<div class="left">Creation Date</div>
					<div class="right">
						<input name=organization.creationDate type="text" class="text"
							value=${organization.creationDate} disabled />
					</div>
					<div class="clear"></div>
				</div>

				<div class="row">
					<div class="left"></div>
					<div class="right">
						<input type="image" src="@{'/public/images/save.png'}"
							alt="Submit" /> 
							
					</div>
					<div class="clear"></div>
				</div>
				
				
				<div class="row">
					<div class="left">* Required Fields</div>
					<div class="right">
						
					</div>
					<div class="clear"></div>
				</div>


			</div>
			
			
</form>


	</div>


</body>

</html>
